package com.ddwl.user.dao.model;

import com.ddwl.common.dao.model.BaseModel;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Table;
import java.math.BigDecimal;

/**
 * 类UserDistStatistical.java的实现描述：用户分销信息统计表
 *
 * @author zach
 * @Date :2020-08-31 14:43.
 */
@Setter
@Getter
@Table(name="sys_user_dist_statistical")
public class UserDistStatistical extends BaseModel {

    /**
     * 用户Id
     */
    private String userId;
    /**
     * 用户推广订单总量(只统计用户付款的订单)
     */
    private Integer totalOrder;
    /**
     * 用户推广总金额(只统计用户付款的订单)
     */
    private BigDecimal totalAmount;
    /**
     * 佣金总额
     */
    private BigDecimal totalCommission;
    /**
     * 推广分销用户数
     */
    private Integer totalUseUser;
    /**
     * 推广商城用户数
     */
    private Integer totalMallUseUser;
    /**
     * 总分享次数
     */
    private Integer totalShare;
    /**
     * 用户分销文件
     */
    private String files;


    public static UserDistStatistical initUserDistStatistical(String userId){
        UserDistStatistical userDistStatistical = new UserDistStatistical();
        userDistStatistical.setTotalAmount(BigDecimal.ZERO);
        userDistStatistical.setTotalCommission(BigDecimal.ZERO);
        userDistStatistical.setTotalOrder(0);
        userDistStatistical.setTotalShare(0);
        userDistStatistical.setTotalUseUser(0);
        userDistStatistical.setTotalMallUseUser(0);
        userDistStatistical.setUserId(userId);
        return userDistStatistical;
    }
}
